﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace CommunitySystemModel
{

    [Serializable]
    [DataContract]
    public class DataDictionaryModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged(string PropName)
        {
            if (PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(PropName));
            }
        }

        
        private int _Id;
        [DataMember]
        public int Id
        {
            get { return _Id; }
            set { _Id = value; this.OnPropertyChanged("Id"); }
        }

        private string _dictCode;
        [DataMember]
        public string DictCode
        {
            get { return _dictCode; }
            set { _dictCode = value; this.OnPropertyChanged("DictCode"); }
        }



        private string _dictName;

        [DataMember]
        public string DictName
        {
            get { return _dictName; }
            set { _dictName = value; this.OnPropertyChanged("DictName"); }
        }


        /// <summary>
        /// 
        /// </summary>
        private bool _isDynamic;

        [DataMember]
        public bool IsDynamic
        {
            get { return _isDynamic; }
            set { _isDynamic = value; this.OnPropertyChanged("IsDynamic"); }
        }
        /// <summary>
        /// 
        /// </summary>
        private string _dynamicSQL;

        [DataMember]
        public string DynamicSQL
        {
            get { return _dynamicSQL; }
            set { _dynamicSQL = value; this.OnPropertyChanged("DynamicSQL"); }
        }


        /// <summary>
        /// 
        /// </summary>
        private bool _isSystem;

        [DataMember]
        public bool IsSystem
        {
            get { return _isSystem; }
            set { _isSystem = value; this.OnPropertyChanged("IsSystem"); }
        }


        /// <summary>
        /// 
        /// </summary>
        private bool _isAutoLoad;

        [DataMember]
        public bool IsAutoLoad
        {
            get { return _isAutoLoad; }
            set { _isAutoLoad = value; this.OnPropertyChanged("IsAutoLoad"); }
        }


        /// <summary>
        /// 
        /// </summary>
        private bool _isTree;

        [DataMember]
        public bool IsTree
        {
            get { return _isTree; }
            set { _isTree = value; this.OnPropertyChanged("IsTree"); }
        }

        /// <summary>
        /// 
        /// </summary>
        private bool _canDelete;

        [DataMember]
        public bool CanDelete
        {
            get { return _canDelete; }
            set { _canDelete = value; this.OnPropertyChanged("CanDelete"); }
        }

        private ObservableCollection<DataDictionaryItemModel> _Items = new ObservableCollection<DataDictionaryItemModel>();
        [DataMember]
        public ObservableCollection<DataDictionaryItemModel> Item
        {
            get { return _Items; }
        }
    }
}
